import java.util.LinkedList;
import java.util.*;

public class Test {
    public static void main(String[] args){
        LinkedList<String> list=new LinkedList<>();
        StringBuilder result1;
        int result2;
        String expression, again;
        System.out.println("请输入一个中缀表达式并以#结束");
        Scanner scanner=new Scanner(System.in);
        String s;
        while (!(s=scanner.next()).equals("#")) {
            list.add(s);
        }
        MyBC hz=new MyBC();
        result1 = hz.houzhui(list);
        System.out.println("后缀表达式： "+result1);
        MyDC evaluator = new MyDC();
        result2 = evaluator.evaluate(result1);
        System.out.println("That expression equals " + result2);
        System.out.println();

    }
}